
<h2><%= current_account.name %>'s Projects</h2>

<script type="text/javascript">
	$(function(){
		var managers = '<%= @managers %>'
		var json = eval("("+ managers + ")");
		var arr = new Array();
		for (var i = 0; i < json.length; i++) {
			arr.push("'"+json[i].user.id+"':'"+json[i].user.name+"'");
		}
		vars = arr.join(",");
		/* Select managers */
		$(".select-project-manager").editable("/projects/update_manager", {
			data: "{"+ vars +"}",
			type: "select",
			submitdata: { format: 'js' },
			submit: "ok"
		});
	});
</script>

<table>
	<th>Created</th>
	<th>Project</th>
	<th>Description</th>
	<th>Project manager</th>
	<%= render :partial => 'project', :collection => @projects %>
</table>
